package com.asiainfo.lop;

import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;

import com.asiainfo.lop.reflash.PullDownElasticImp;
import com.asiainfo.lop.reflash.PullDownScrollView;

/**
 * Created by wucm(wucm@asiainfo.com) on 2016/5/29 16:23.
 */
public class ReflashMain extends Activity implements PullDownScrollView.RefreshListener {

    private PullDownScrollView mPullDownScrollView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.reflash_main);

        mPullDownScrollView = (PullDownScrollView) findViewById(R.id.refresh_root);
        mPullDownScrollView.setRefreshListener(this);
        mPullDownScrollView.setPullDownElastic(new PullDownElasticImp(this));
    }

    @Override
    public void onRefresh(PullDownScrollView view) {
        new Handler().postDelayed(new Runnable() {

            @Override
            public void run() {
                mPullDownScrollView.finishRefresh("上次刷新时间:12:23");
            }
        }, 2000);
    }

}
